<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div class="tiaozhuan" id="tiaozhuan">

    </div>
</body>
<script>
    var demo=document.getElementById("tiaozhuan");
    var secot=5;
    demo.innerHTML="还剩"+secot+"秒跳转页面";
    setTimeout(fn,1000)
    function fn() {
        if (secot<=0){
            window.location.href="http://www.baidu.com";
        } else {
            secot--
            setTimeout(fn,1000);
            demo.innerHTML="还剩"+secot+"秒跳转页面";
        }
    }
</script>
</html>